/*!
 * Fichier de déclaration des fonctions et variables concernant la Cellule.
 * @author Yannis Mazzer 10610676
 */
#ifndef CELL_H
#define CELL_H

#define MAX 20

#include <QString>
#include <QVector>

typedef QString dataType;

class Cell
{
    public:

/*!
 * Default Cell class constructor.
 */
	Cell();

/*!
 * Cell class constructor.
 * @param value Value you whish to put in the cell.
 * @param max Maximum size of the skiplist.
 */
	Cell(dataType value,const int max);

/*!
 * Function to set the value of the element in an already existing cell.
 * @param value Value you wish to put in the cell.
 */
	void set(dataType value);

/*!
 * Function that returns the contents of the cell.
 * @return tmp Value in the cell.
 */
	dataType get(void);

/*!
 * Function that returns the height of the cell.
 * @return height Height of the cell.
 */
	int getHeight(void);

/*!
 * Function to set the height of the cell.
 * @param newheight Height of the cell.
 */
	void setHeight(int newheight);

/*!
 * Function that returns the next cell.
 * @param height Height of the cell.
 * @return The next cell.
 */
	Cell *getNext(int height);

/*!
 * Founction to set the next cell.
 * @param height Height of the cell.
 * @param *newNext New cell.
 */
	void setNext(int height, Cell *newNext);

    private:

/*!
 * Function that returns a random number that will be the height of the cell.
 * @param max Maximum height of a cell.
 * @return rand random number.
 */
	int randHeight(const int max);

	dataType data;
	int height;
	QVector<Cell *> next;

};

#endif // CELL_H
